package com.jf.hotelreservation.demos.controller;

import com.alibaba.fastjson2.JSON;
import com.jf.hotelreservation.demos.bean.Tags;
import com.jf.hotelreservation.demos.service.TagsService;
import com.jf.hotelreservation.demos.service.impl.TagsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/tags")
public class TagsController {

    @Autowired
    private TagsService tagsService;

    @PostMapping("/add")
    public String add(@RequestBody Tags tags){
        return tagsService.addTags(tags);
    }

    @GetMapping("/queryAll")
    public String queryAll(int currentPage,int pageSize){
        return tagsService.queryAll(currentPage,pageSize);
    }

    @GetMapping("/queryByHotel")
    public String queryByHotel(){
        return tagsService.queryByHotel();
    }
}
